﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Meraz.Core.Model;

namespace Meraz.Core.Repositories
{
    public class FrameRepository : EFRepositoryBase<Frame, int>, IFrameRepository
    {
        public FrameRepository() : base() { }
        public FrameRepository(Data.IMerazContext context) : base(context) { }
        public override Frame GetById(int id)
        {
            return context.Frames
                .Where(where1 => where1.ID == id)
                .FirstOrDefault();
        }

        public override void Add(Frame entity)
        {
            context.Frames.AddObject(entity);
        }

        public override void Delete(Frame entity)
        {
            context.Frames.DeleteObject(entity);
        }

        public override List<Frame> All()
        {
            return context.Frames.ToList();
        }
    }
}
